<script setup>
defineProps({
  title: {
    type: String,
    default: ''
  }
})
</script>
<template>
  <el-card class="page-card">
    <template #header>
      <div class="header">
        <!-- 父传子传标题 -->
        <span>{{ title }}</span>
        <div class="extra">
          <!-- 插槽 -->
          <slot name="extra"></slot>
          <!-- <el-button type="primary">添加分类</el-button> -->
        </div>
      </div>
    </template>
    <!-- 插槽 -->
    <slot></slot>
  </el-card>
</template>
<style scoped>
.page-card {
  min-height: 100%;
  box-sizing: border-box;
}
.page-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
